﻿using AutoRegistDependency.Attributes;
using AutoRegistDependency.Enum;
using Microsoft.Extensions.Configuration;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace Core.QuartzService
{
    //[DisallowConcurrentExecution]
    [Component(lifetime:LifeTimeType.SingleInstance)]
    [Job("0 0/1 * * * ?")]
    public class StandardsJob : IJob
    {
        public IConfiguration Configuration { get; }
        public StandardsJob(IConfiguration Configuration)
        {
            this.Configuration = Configuration;
        }
        public Task Execute(IJobExecutionContext context)
        {
            return Task.Run(() =>
            {
                Console.WriteLine("定时任务开始执行!");
                Console.WriteLine(Configuration["AESKey"]);
            });
        }
    }
}
